<HTML><HEAD><TITLE>library(sd)</TITLE></HEAD><BODY>
[ <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]<H1>library(sd)</H1>
Simple solver for constraints over unordered symbolic domains
<H2>Predicates</H2>
<BLOCKQUOTE>
<DL>
<DT><A HREF="YNN-2.html"><STRONG>?Vars &:: +Domain</STRONG></A></DT>
<DD>All elements of Vars have a value in the domain Domain</DD>
<DT><A HREF="YE-2.html"><STRONG>?X &= ?Y</STRONG></A></DT>
<DD>X is the same atomic value as Y</DD>
<DT><A HREF="YE-3.html"><STRONG>&=(?X, ?Y, ?Bool)</STRONG></A></DT>
<DD>Reified version of X &= Y</DD>
<DT><A HREF="YRE-2.html"><STRONG>?X &\= ?Y</STRONG></A></DT>
<DD>X is different from Y</DD>
<DT><A HREF="YRE-3.html"><STRONG>&\=(?X, ?Y, ?Bool)</STRONG></A></DT>
<DD>Reified version of X &\= Y</DD>
<DT><A HREF="alldifferent-1.html"><STRONG>alldifferent(?List)</STRONG></A></DT>
<DD>All elements of List are different</DD>
<DT><A HREF="deleteff-3.html"><STRONG>deleteff(-Min, +List, -Rest)</STRONG></A></DT>
<DD>Pick minimum domain size element from a list (first fail principle)</DD>
<DT><A HREF="get_domain_as_list-2.html"><STRONG>get_domain_as_list(?Term, -List)</STRONG></A></DT>
<DD>Retrieves the domain of a variable (or value) as a list of values</DD>
<DT><A HREF="get_domain_size-2.html"><STRONG>get_domain_size(?Term, -Size)</STRONG></A></DT>
<DD>Gives the size of the domain of a variable (or value)</DD>
<DT><A HREF="indomain-1.html"><STRONG>indomain(?X)</STRONG></A></DT>
<DD>Nondeterministically instantiate to domain values</DD>
<DT><A HREF="is_exact_solver_var-1.html"><STRONG>is_exact_solver_var(?Term)</STRONG></A></DT>
<DD>The argument is a domain variable</DD>
<DT><A HREF="is_solver_type-1.html"><STRONG>is_solver_type(?Term)</STRONG></A></DT>
<DD>The argument is a domain variable or atomic constant</DD>
<DT><A HREF="is_solver_var-1.html"><STRONG>is_solver_var(?Term)</STRONG></A></DT>
<DD>The argument is a domain variable</DD>
<DT><A HREF="labeling-1.html"><STRONG>labeling(+Term)</STRONG></A></DT>
<DD>Instantiate all domain variables in a list to domain values</DD>
<DT><A HREF="msg-3.html"><STRONG>msg(?X, ?Y, -MSG)</STRONG></A></DT>
<DD>MSG is the most specific generalisation of X and Y representable with domain variables from this library</DD>
</DL>
</BLOCKQUOTE>
<H2>Other Exports</H2>
<BLOCKQUOTE><DL>
<DT><STRONG>export op(700, xfx, [&::, &=, &\=])</STRONG></DT><DD></DD>
</DL></BLOCKQUOTE>
<H2>Description</H2>

    <H4>Overview</H4>
    <P>
    This is a simple library implementing variables and constraints over
    atomic values.  Its main purpose is for first experiments with constraint
    solving.  Moreover, those interested in writing their own constraint
    solvers can use the source code of this library as a starting point.
    <H4>Domains</H4>
    Domains are declared by giving a list of possible values for a variable,
    e.g.
    <PRE>
    	?- X &amp;:: [red, green, blue].
	X = X{[blue, green, red]}
	Yes (0.00s cpu)
    </PRE>
    A variable that has been given a domain can only be instantiated to
    values from this domain. Any attempt to instantiate the variable to
    a non-domain value will cause failure:
    <PRE>
    	?- X &amp;:: [red, green, blue], X = red.
	X = red
	Yes (0.00s cpu)
    	?- X &amp;:: [red, green, blue], X = yellow.
	No (0.00s cpu)
    </PRE>
    <H4>Basic Constraints</H4>
    There are only two basic constraints, equality and disequality:
    <DL>
    <DT>X &amp;= Y</DT><DD>X is the same as Y</DD>
    <DT>X &amp;\= Y</DT><DD>X is different from Y</DD>
    </DL>
    Both constraints exist in a reified form:
    <DL>
    <DT>&amp;=(X,Y,Bool)</DT><DD>Bool is the truth value (0/1) of X &amp;= Y</DD>
    <DT>&amp;\=(X,Y,Bool)</DT><DD>Bool is the truth value (0/1) of X &amp;\= Y</DD>
    </DL>
    </PRE>
    <H4>Global Constraints</H4>
    One derived, global constraint is implemented:
    <DL>
    <DT>alldifferent(List)</DT><DD>All list elements are different</DD>
    </DL>
    <H4>Search</H4>
    Domain variables can be instantiated to their domain values using
    <DL>
    <DT>indomain(X)</DT><DD>enumerate values of X</DD>
    <DT>labeling(Xs)</DT><DD>enumerate values of all elements of list Xs</DD>
    </DL>
    
<H2>About</H2><UL COMPACT>
<LI><STRONG>Author: </STRONG>Joachim Schimpf
<LI><STRONG>Copyright &copy; </STRONG>Cisco Systems, Inc.
<LI><STRONG>Date: </STRONG>$Date: 2009/03/17 13:51:18 $
</UL>
<HR>Generated from sd.eci on 2009-05-27 01:25
</BODY></HTML>
